package com.yunshipei.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

public class MainViewTabAdapter extends FragmentStatePagerAdapter {

    private List<Fragment> viewTabList;

    public MainViewTabAdapter(FragmentManager manager, List<Fragment> viewTabList) {
        super(manager);
        this.viewTabList = viewTabList;
    }

    @Override
    public Fragment getItem(int position) {
        return viewTabList.get(position);
    }

    @Override
    public int getCount() {
        return viewTabList == null ? 0 : viewTabList.size();
    }
}
